package com.stray.crawl.expr;

public abstract class Express {

	protected Object doParse(EventData event) {
		Object source = event.getObject();
		String args = event.getArguments();

		return doParse(source, args);
	}

	protected Object doParse(Object obj, String args) {
		return obj;
	}

	protected String getName() {
		String name = this.getClass().getSimpleName();

		for (int i = name.length() - 1; i > 0; i--) {
			if (Character.isUpperCase(name.charAt(i))) {
				return Character.toLowerCase(name.charAt(0)) + name.substring(1, i);
			}
		}

		return name.toLowerCase();
	}

}